<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>布局视口</title>
</head>
<body>
    <div id="result">
        
    </div>
    <script>
        //获取布局视口的宽度
        // console.log('布局视口的宽度' + document.documentElement.clientWidth);
        //获取 result 元素
        let result = document.querySelector('#result');
        //设置文本
        result.innerHTML = '布局视口的宽度' + document.documentElement.clientWidth;
    </script>
</body>
</html>